<?php
/* @var $this CandidateController */
/* @var $model Candidate */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'candidate-form',
	'enableAjaxValidation'=>false,
    'htmlOptions' => array('enctype'=>'multipart/form-data'),
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>128)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>

    <div class="row">
        <?php echo $form->labelEx($model,'numbers'); ?>
        <?php echo $form->textField($model,'numbers',array('size'=>60,'maxlength'=>128)); ?>
        <?php echo $form->error($model,'numbers'); ?>
    </div>

	<div class="row">
		<?php echo $form->labelEx($model,'befrom'); ?>
		<?php echo $form->textField($model,'befrom',array('size'=>60,'maxlength'=>128)); ?>
		<?php echo $form->error($model,'befrom'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php echo $form->textArea($model,'description',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'description'); ?>
	</div> 

<!--	<div class="row">-->
<!--		--><?php //echo $form->labelEx($model,'hit'); ?>
		<?php //echo $form->textField($model,'hit'); ?>
		<?php //echo $form->error($model,'hit'); ?>
<!--	</div>-->
<!---->
<!--	<div class="row">-->
<!--		--><?php //echo $form->labelEx($model,'poll'); ?>
		<?php //echo $form->textField($model,'poll'); ?>
<!--		--><?php //echo $form->error($model,'poll'); ?>
<!--	</div>-->

    <div class="row">
        <?php echo $form->labelEx($model,'thumbnail'); ?>

        <?php echo CHtml::activeFileField($model,'thumbnail');?>
        <?php echo $form->error($model,'thumbnail'); ?>
    </div>

    <div class='row'>
        <?php echo '图片预览<br>' ?>
        <?php 
           $showpic = Yii::app()->baseUrl.$model->thumbnail;
          if($model->thumbnail ==null){
            $showpic = Yii::app()->baseUrl.'/images/w/test.png';
          } 

        echo '<img src="'.$showpic.' " style="width:200px;height:300px;"/>';
         ?>
    </div>

<!--	<div class="row">-->
<!--		--><?php //echo $form->labelEx($model,'createtime'); ?>
		<?php //echo $form->textField($model,'createtime'); ?>
<!--		--><?php //echo $form->error($model,'createtime'); ?>
<!--	</div>-->

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->